#!/bin/sh

### BEGIN INIT INFO
# Provides:          onlineradio
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

case "$1" in
  stubru)
    echo "Starting $1"
    gst-launch playbin2 uri=http://mp3.streampower.be/stubru-high.mp3 1>/dev/null 2>/dev/null &
    ;;
  psyradio)
    echo "Starting $1"
    gst-launch playbin2 uri=http://81.88.37.2:8030  1>/dev/null 2>/dev/null &
    ;;
  stop)
    echo "Stopping online radio"
    kill $(pgrep gst-launch)
    ;;
  *)
    echo "Usage: /etc/init.d/onlineradio {stubru|psyradio|stop}"
    exit 1
    ;;
esac

exit 0

